<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>系统人员</title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />

</head>
<body>

<div style="margin: 20px">
    <form class="layui-form layui-form-pane">
        <input type="hidden" id="beImg" name="beImg">
        <div class="layui-form-item">
            <label class="layui-form-label">商品参数名称</label>
            <div class="layui-input-block">
                <input class="layui-input" name="parameterName" autocomplete="off" placeholder="输入品牌名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品参数值</label>
            <div class="layui-input-block">
                <input class="layui-input" name="parameterValue" autocomplete="off" placeholder="输入品牌的介绍">
            </div>
        </div>
        <div class="layui-form-item" style="display: none">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit="" lay-filter="submitBtn" id="submitBtn"></a>
            </div>
        </div>
    </form>
</div>
</body>
<script>
    var $;
    layui.use(['form','jquery','upload','element','layer'],function () {
        var form = layui.form,
            upload = layui.upload,
            layer = layui.layer,
            elem = layui.element;
        $ = layui.jquery;



        form.on('submit(submitBtn)',function (data) {

            var formData = data.field;

            $.ajax({
                type:'post',
                url:'/system/pc/add',
                data:formData,
                dataType:'json',
                success:function (result) {
                    layer.msg(result.msg);
                    if(result.is){
                        let index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);//关闭父页面窗口

                    }
                }
            })
        })

    })

    function btnSubmit() {
        $('#submitBtn').click();
    }
</script>
</html>